<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>square</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .pkBox{
            width: 155px;
            height: 155px;
            position: relative;
            margin:300px auto;
        }
        .pkBox > div{
            width: 100%;
            height: 100%;
            border:1px solid #000;
            border-radius: 10px;
            position: absolute;
            left: 0;
            top: 0;
            /*添加过渡*/
            /* transition: transform 1s; */
            /*设置旋转轴心*/
            transform-origin: center center;
        }
        /*添加鼠标上移的效果*/
        .pkBox div:nth-of-type(1){
            animation: an1 2s linear infinite;
        }
        .pkBox >div:nth-of-type(2){
            animation: an2 2s linear infinite;
        }
        .pkBox >div:nth-of-type(3){
            animation: an3 2s linear infinite;
        }
        .pkBox >div:nth-of-type(4){
            animation: an4 2s linear infinite;
        }
        .pkBox >div:nth-of-type(5){
            animation: an5 2s linear infinite;
        }
        .pkBox >div:nth-of-type(6){
            animation: an6 2s linear infinite;
        }
        .pkBox >div:nth-of-type(7){
            animation: an7 2s linear infinite;
        }
        .pkBox >div:nth-of-type(8){
            animation: an8 2s linear infinite;
        }
        .pkBox >div:nth-of-type(9){
            animation: an9 2s linear infinite;
        }
        @keyframes an1 {
            0% {
                transform: rotate(0)
            }
            50% {
                transform: rotate(5deg);
            }
            100% {
                transform: rotate(0)
            }
            
        }
        @keyframes an2 {
            0% {
                transform: rotate(0)
            }
            50% {
                transform: rotate(10deg);
            }
            100% {
                transform: rotate(0)
            }
        }
        @keyframes an3 {
            0% {
                transform: rotate(0)
            }
            50% {
                transform: rotate(15deg);
            }
            100% {
                transform: rotate(0)
            }
        }
        @keyframes an4 {
            0% {
                transform: rotate(0)
            }
            50% {
                transform: rotate(20deg);
            }
            100% {
                transform: rotate(0)
            }
        }
        @keyframes an5 {
            0% {
                transform: rotate(0)
            }
            50% {
                transform: rotate(25deg);
            }
            100% {
                transform: rotate(0)
            }
        }
        @keyframes an6 {
            0% {
                transform: rotate(0)
            }
            50% {
                transform: rotate(30deg);
            }
            100% {
                transform: rotate(0)
            }
        }
        @keyframes an7 {
            0% {
                transform: rotate(0)
            }
            50% {
                transform: rotate(35deg);
            }
            100% {
                transform: rotate(0)
            }
        }
        @keyframes an8 {
            0% {
                transform: rotate(0)
            }
            50% {
                transform: rotate(40deg);
            }
            100% {
                transform: rotate(0)
            }
        }
        @keyframes an9 {
            0% {
                transform: rotate(0)
            }
            50% {
                transform: rotate(45deg);
            }
            100% {
                transform: rotate(0)
            }
        }
    </style>
</head>
<body>
    <div class="pkBox">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </div>
</body>
</html>